package com.mathpractise.dto.response;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mathpractise.dto.QuestionDTO;

/**
 * 答题响应DTO
 */
public class AnswerQuestionResponseDTO {
    
    /**
     * 是否是最后一题
     */
    private boolean isLastQuestion;
    
    /**
     * 下一题（如果是最后一题则为null）
     */
    private QuestionDTO nextQuestion;
    
    public AnswerQuestionResponseDTO() {
    }
    
    public AnswerQuestionResponseDTO(boolean isLastQuestion, QuestionDTO nextQuestion) {
        this.isLastQuestion = isLastQuestion;
        this.nextQuestion = nextQuestion;
    }
    
    // Getters and setters
    
    @JsonIgnore
    public boolean isLastQuestion() {
        return isLastQuestion;
    }
    
    public void setLastQuestion(boolean lastQuestion) {
        isLastQuestion = lastQuestion;
    }
    
    public boolean isHasNextQuestion() {
        return !isLastQuestion;
    }
    
    public QuestionDTO getNextQuestion() {
        return nextQuestion;
    }
    
    public void setNextQuestion(QuestionDTO nextQuestion) {
        this.nextQuestion = nextQuestion;
    }
}